package com.example.xd.fmpeg_test;

import android.content.Context;
import android.content.res.AssetManager;
import android.support.annotation.NonNull;


import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class AssetsUtil {

    public static List<String> getAssetFileList(Context context, String dir) {
        List<String> list = new ArrayList<>();
        AssetManager assetManager = context.getAssets();
        try {
            for (String fileName : assetManager.list(dir)) {
                list.add("file:///android_asset/" + dir + File.separator + fileName);
            }
        } catch (IOException | NullPointerException e) {
            e.printStackTrace();
        }
        return list;
    }

}
